package org.mogu.control.util;

import org.mogu.ContactListActivity;
import org.mogu.R;
import org.mogu.control.model.IMUser;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;


public class QQAdapterOnItemClickListener implements OnItemClickListener {
	
	private ContactListActivity mContext = null;
	
	
	public QQAdapterOnItemClickListener(ContactListActivity paramActivity){
		mContext = paramActivity;
	}
	
	@Override
	public void onItemClick(AdapterView<?> arg0, View  v, int position, long id) {
			// TODO Auto-generated method stub
	    	
			IMUser iMUser = (IMUser)arg0.getItemAtPosition(position);
			iMUser.setCount(0);
			
			TextView name = (TextView)v.findViewById(R.id.recent_name);
			name.setText(iMUser.getUnicename());
	    
			Bundle bundle = new Bundle();
			bundle.putSerializable("iMUser", iMUser);
			mContext.onChildClick(bundle);
	    	
	}

}
